;; 配置melpa源
(setq package-archives '(("gnu"   . "http://mirrors.tuna.tsinghua.edu.cn/elpa/gnu/")
                         ("melpa" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/melpa/")))
;; 关闭包校验
(setq package-check-signature nil)
;; 引入包模块
(require 'package)
;; 初始化包
(unless (bound-and-true-p package--initialized)
  (setq package-enable-at-startup nil)
  (package-initialize))
;; 刷新包缓存
(unless package-archive-contents
  (package-refresh-contents))
;; 安装 use-package 包
(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))
;; 加载 use-package
(eval-when-compile
  (require 'use-package))
;; 配置 use-package
(eval-and-compile
  (setq use-package-always-ensure t
        use-package-always-defer t
        use-package-always-demand nil
        use-package-expand-minimally t
        use-package-verbose t))
(setq load-prefer-newer t)

(provide 'init-elpa)
